﻿------------------------------------------------
-- CSDL cho Project Tham Dinh Gia
-- Ngay khoi tao: 20-4-2011 
-- Update 1: 27-4-2011 : sua lai theo yeu cau moi, cap nhat bang tham so, them thong tin GPS
------------------------------------------------
--DROP ALL TABLES IF THEY ARE EXISTS
GO
IF EXISTS(SELECT 1 FROM sysobjects WHERE ID = OBJECT_ID(N'GIA_DOAN_DUONG') AND type = (N'U'))
DROP TABLE GIA_DOAN_DUONG
GO
--------------------------------------------------------------------
-- Tao bang GIA_DOAN_DUONG

CREATE TABLE GIA_DOAN_DUONG (
	MA_GDD BIGINT IDENTITY(1, 1) PRIMARY KEY ,
	MA_DKS BIGINT ,
	GIA_DAT float,
	NGUOI_KHOI_TAO uniqueidentifier ,
	NGAY_KHOI_TAO DATETIME,
	NGAY_CAP_NHAT DATETIME,
	ACTIVE_FLAG CHAR(1) DEFAULT 'Y',
	FOREIGN KEY (MA_DKS) REFERENCES DUONG_KHAO_SAT(MA_DKS),
)
INSERT INTO GIA_DOAN_DUONG VALUES (1,0,'55BDE91C-7B70-4CFE-A5D6-90BF88DB7AEF',CURRENT_TIMESTAMP,NULL,'Y')
